<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>组件化</title>
    <script src="vue.js"></script>
</head>
<body>
<div id="app">
    <counnt heading="like"></counnt>
    <counnt heading="dislike"></counnt>
    <template id="my-template">
        <h1>hello world</h1>
        <button @click="count +=1">submit{{count}}</button>
    </template>
</div>
<script type="text/javascript">
    Vue.component('counnt',{
        template:'#my-template',
        props:['like'],
        data:function () {
            return {count:0};
        }
    });
    new Vue({
        el:'#app',
        data:{
            count:0
        },
        methods:{
            update:function(){
                this.count ++;
            },
            todo:function () {

            }
        }
    });
</script>
</body>
</html>